<extend name="Public:main" />

<block name="cssjs"></block>


<block name="area"><li><a href="#">修改疾病分类</a></li></block>

<block name="content">
    <div class="formbody">
		<div class="formtitle"><span>修改</span></div>
		<form action="__ACTION__" method="post" enctype="multipart/form-data" name="myform">
		<ul class="forminfo">
			<input type="hidden" name="id" value="{$cate_row.id}" />
			<input type="hidden" name="hid" value="{$cate_row.hid}" id="hospitalid"/>
			<li><label>账号:</label><input name="phone" class="dfinput" type="text" value="{$cate_row.phone}"><i></i></li>
			<li><label>昵称:</label><input name="nickname" class="dfinput" type="text" value="{$cate_row.nickname}"><i></i></li>
			<li><label>积分:</label><input name="integral" class="dfinput" type="text" value="{$cate_row.integral}"><i></i></li>
			<li><label>性别:</label><input name="sex" type="radio" value="男" <if condition="$cate_row.sex eq '男'">checked</if>>男 &nbsp;&nbsp;&nbsp;&nbsp;
				<input name="sex" type="radio" value="女" <if condition="$cate_row.sex eq '女'">checked</if>>女<i></i></li>
			<li>
				<label>医院:</label>
				<input type="text" id="searchyy" name="hospital" class="dfinput" value="{$cate_row.hospital}" placeholder="输入医院名称进行搜索">
			</li>
			<li>
				<div class="yy-n">
					<p id="meg" class="meg" style="display:none;"></p>
					<ul class="list-hospital" id="id_select" style="height:25rem; overflow-y:scroll; width:30%;">
					</ul>
				</div>
			</li>
			<li><label>&nbsp;</label><input  type="submit" class="btn" value="确认修改"/></li>
		</ul>
		</form>
    </div>
	<script>
        $().ready(function() {
            //输入框键盘按键松开事件
            $("#searchyy").keyup(function() {
                $('.yy-n').css('display','block');
                now = $.trim($('#searchyy').val());
                $("#hospitalid").val();
                if (now != '') {
                    var searchyy = $('#searchyy').val();
                    $("#meg").hide();
                    $("#id_select").hide();
                    if (searchyy != '') {
                        $.ajax({
                            type: "POST",
                            url: "__MODULE__/Doctor/search",
                            cache: false,
                            data: {name: searchyy},
                            dataType: 'json',
                            success: function (result) {
                                if (result.code == 0) {
                                    var arr = result.data;
                                    var str = '';
                                    console.log(arr);//return 0;
                                    $("#id_select").show();
                                    $("#id_select").html('');
                                    $.each(arr, function (i) {
                                        str += '<li data-id="' + this.id + '" class="" onclick="clickbtna(this)">' + this.name + '</li>';
                                    });
                                    $("#id_select").html(str);
                                } else {
                                    $("#meg").show();
                                    $("#meg").html('');
                                    $("#meg").html(result.data);
                                }
                            }
                        });
                    }
                }
            });
        });
        function clickbtna(obj){
            var a = $(obj).html();
            var id = $(obj).attr('data-id');
            $("#searchyy").val(a);
            $("#hospitalid").val(id);
            $('.yy-n').css('display','none');
        }
	</script>
</block>